package com.example.administrator.himalaya.adapter;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;

import java.util.List;

/**
 * Created by Administrator on 2016/12/12.
 */

public class MasterFragmentAdapter extends FragmentPagerAdapter {
    private List<Fragment> fragments;
    private Context context;

    public MasterFragmentAdapter(FragmentManager fm,List<Fragment> fragments,Context context) {
        super(fm);
        this.fragments =fragments;
        this.context=context;
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments==null?0:fragments.size();
    }


}
